Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Port MicroLogging.InteractiveLogger as Logging.ConsoleLogger #25136

Closed
wants to merge 1 commit into from

Conversation

c42f
Copy link
Member

@c42f c42f commented Dec 16, 2017

This is more or less a direct port of MicroLogging.InteractiveLogger. It's a bit hacky but might help for comparison with #25111 and other efforts to improve log formatting.

Features:

  • Render log messages as Markdown
  • Print exceptions with showerror
  • Right justified metadata
  • Per module log level filtering
  • Progress bar support
  • Configurable exception passthrough from logging layer

I'm not quite sure how or whether to install this by default. As part of Logging rather than Base, it looks like installing it will need to be done differently from SimpleLogger, which I put into Base.__init__()

console_logger

end

"""
configure_logging(logger::ConsoleLogger, [_module]; min_level=Info)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub code formatting flips out from the _module variable name, same thing happens here:

handle_message(logger, level, message, _module, group, id, file, line; key1=val1, ...)
and later in this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so that's what's going on. Looks like it's already fixed:

JuliaEditorSupport/atom-language-julia#134

@c42f
Copy link
Member Author

c42f commented Dec 16, 2017

Looking over this code again, I'd say it's definitely in "interesting PoC" territory, but I've got misgivings about the implementation. Some things which I'm not happy about:

  • I'm still using string to format the values in the key value pairs by default. It seems like I should be making better use of the display system here, but I don't know a lot about that so any hints on the best way to do it would be great.
  • Using Markdown.term directly is almost certainly a bad idea.
  • Munging strings containing ANSI color codes is a mess. If we modified Base.Markdown.term to make splitting by lines safe, this would be less bad.

Generally speaking, I think a lot of these woes are due to my lack of understanding in how to compose functionality from the display system with additional decorations we'd like to add to make this stuff really readable. I'm not sure this is even possible in a nice way right now, advice would be greatly appreciated.

@c42f c42f added the logging The logging framework label Jan 5, 2018
@c42f
Copy link
Member Author

c42f commented Jan 12, 2018

Superseded by #25370

@c42f c42f closed this Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logging The logging framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants